﻿package com.cl.edu.entity;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 区域表  存放中国行政区划数据
 * Area entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "area")
public class Area implements java.io.Serializable {

	// Fields

	private String id; //区域id
	private String name; //区域名称
	private String encodeName;
	

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "name", length = 40)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
	public void setEncodeName(String encodeName) {
		this.encodeName = encodeName;
	}
	@Transient
	public String getEncodeName() {
		try {
			return URLEncoder.encode(name, "utf-8");
		} catch (UnsupportedEncodingException e) {
			return "";
		}
	}
}